import request from "../api";

// 根据字典类型查询字典数据信息
export function getDicts(dictType) {
	return request({
		url: "/system/dict/data/type/" + dictType,
		method: "get",
	});
}

//  日充放电量统计-*
export function getdailyDischarge(param) {
	return request({
		url: "/sys/dailyDischarge",
		method: "get",
		params: param,
	});
}

// 4小时实时功率
export const ycHis = (param) => {
	return API.GET("/station/ycHis", param);
};

export function getrevenueRanking(param) {
	return request({
		url: "/sys/revenueRanking",
		method: "get",
		params: param,
	});
}

export const getwarningStatistics = (param) => {
	return API.GET("/sys/warningStatistics", param);
};

// 获取树形菜单
export function getmenu(param) {
	return request({
		url: "/sys/menu",
		method: "get",
		params: param,
	});
}

export function getJWD(param) {
	return request({
		url: "/sys/warningStatistics",
		method: "get",
		params: param,
	});
}

export function getPVmenu(param) {
	return request({
		url: "/pv/menu",
		method: "get",
		params: param,
	});
}
export function getAlarmMenu(param) {
	return request({
		url: "/sys/alarmMenu",
		method: "get",
		params: param,
	});
}

export const getall = (param) => {
	return API.GET("/common/all", param);
};

export function getgraph(param) {
	return request({
		url: "/common/graph",
		method: "get",
		params: param,
	});
}

export function the7thData(param) {
	return request({
		url: "/common/the7thData",
		method: "get",
		params: param,
	});
}

export function monthlyPowerGeneration(param) {
	return request({
		url: "/pv/monthlyPowerGeneration",
		method: "get",
		params: param,
	});
}

export function weeklyPowerGeneration(param) {
	return request({
		url: "/pv/weeklyPowerGeneration",
		method: "get",
		params: param,
	});
}

export function yearPowerGeneration(param) {
	return request({
		url: "/pv/yearPowerGeneration",
		method: "get",
		params: param,
	});
}

// 根据设备id和数据名称查询数据
export function findDataByDevIdAndName(param) {
	return request({
		url: "/common/findDataByDevIdAndName",
		method: "get",
		params: param,
	});
}
// 查询间隔下的psc、电池堆等子数据
export function findChildrenData(param) {
	return request({
		url: "/common/findChildrenData",
		method: "get",
		params: param,
	});
}

export function getRouters() {
	return request({
		url: "/front/getRouters",
		method: "get",
	});
}
